package com.ydzt.fanka.server.utils;

import com.ydzt.fanka.server.domain.Node;

public class ParamUtil {
	public static String getTbaleNameByParamType(int paramType){
		String tableName = ConfigFileUtil.GetValueByKey("P" + paramType,"C:/conf/config/param_table_mapping.xml");
		return tableName;
	}
	
	public static int getOneRecordLength(String path){
		int length = XmlUtil.GetRootNodeAttributeLength(path);
		return length;
	}
	
	public static int getParamNodeCount(String path){
		int count = XmlUtil.getRootNodeAttributeCount(path);
		return count;
	}
	
	public static String getNodeValueString(Node node){
		String strValue = null;
		byte[] value = node.getValue();
		String type = node.getValueType();
		int length = Integer.parseInt(node.getTypeLength());
		strValue = ByteConvert.Convert(type, length, value);
		return strValue;
	}
}

